{ *******************
   MODIFS DELPHI1
********************* }

Function  DpError(_Result:integer) :  Str255;
Var
   Err     : str10;
   S : str255;
   rc      : char;
begin
   Str(_Result,Err);
(*
   Case _Result of
       -1 :          Message := ' Operation Failed ';
        0 :          Message := '';
        2 :          Message := ' File Not Found ';
        3 :          Message := ' Path Not Found ';
        4 :          Message := ' Too Many Open Files ';
        5 :          Message := ' File Access Denied ';
        6 :          Message := ' Invalid File Handle ';
       12 :          Message := ' Invalid File Access Code ';
       15 :          Message := ' Invalid Drive Number ';
       16 :          Message := ' Cannot Remove Current Directory ';
       17 :          Message := ' Cannot Rename Across Drives ';
      100 :          Message := ' Disk Read Error ';
      101 :          Message := ' Disk Write Error ';
      102 :          Message := ' File Not Assigned ';
      103 :          Message := ' File Not Open ';
      104 :          Message := ' File Not Open For Input ';
      105 :          Message := ' File Not Open For Output ';
      106 :          Message := ' Invalid Numeric Format ';
      150 :          Message := ' Disk Is Write-Protected ';
      151 :          Message := ' Unknown Unit ';
      152 :          Message := ' Drive Not Ready ';
      153 :          Message := ' Unknown Command ';
      154 :          Message := ' CRC Error In Data ';
      155 :          Message := ' Bad Drive Request Structure Length ';
      156 :          Message := ' Disk Seek Error ';
      157 :          Message := ' Unknown Media Type ';
      158 :          Message := ' Sector Not Found ';
      159 :          Message := ' Printer Out Of Paper ';
      160 :          Message := ' Device Write Fault ';
      161 :          Message := ' Device Read Fault ';
      200 :          Message := ' Division By Zero ';
      201 :          Message := ' Range Check Error ';
      202 :          Message := ' Stack Overflow Error ';
      203 :          Message := ' Heap Overflow Error ';
      204 :          Message := ' Invalid Pointer Operation ';
      205 :          Message := ' Floating Point Overflow ';
      206 :          Message := ' Floating Point Underflow ';
      207 :          Message := ' Invalid Floating Point Operation ';
      501 :          Message := ' Invalid Operation ';
      502 :          Message := ' End of File Reached ';
      503 :          Message := ' Number of Fields Out of Range for DBF ';
      504 :          Message := ' Invalid Field Name or Type ';
      505 :          Message := ' Value of ID for Properly Opened File ';
      506 :          Message := ' DBF File Not properly Opened ';
      507 :          Message := ' General Error Condition ';
      508 :          Message := ' File not in .DBF format ';
      509 :          Message := ' File not in .NDX format ';
      510 :          Message := ' Key not found or .NDX file empty ';
      511 :          Message := ' Key not found, but next was located ';
      512 :          Message := ' At end of index file ';
      513 :          Message := ' At top of index file ';
      514 :          Message := ' Memory Allocation Error ';
      515 :          Message := ' Not Found ';
      516 :          Message := ' File not in .DBT format or corrupt ';
      517 :          Message := ' Error with expression in dp_evaluate ';
      518 :          Message := ' NDX File Not properly Opened ';
      519 :          Message := ' DBT File Not properly Opened ';
      520 :          Message := ' Record meeting condition Reached ';
      521 :          Message := ' Illegal character in field name ';
      522 :          Message := ' Field type must be MCNL or D ';
      523 :          Message := ' DField width out of range ';
      524 :          Message := ' Number of decimal placs out of range ';
      525 :          Message := ' No match on join field ';
      526 :          Message := ' Record number out of range ';
      540 :          Message := ' File/record locked ';
      541 :          Message := ' File/record locked by self ';
      542 :          Message := ' Rec locked by self ';
      543 :          Message := ' DBF locked by self ';
      544 :          Message := ' NrRecs bytes locked by self ';
      545 :          Message := ' File/record never locked by self ';
      546 :          Message := ' File/record not locked ';
      547 :          Message := ' Illegal locking action ';
   end;
*)
      if (_Result >=-1) and (_Result <=547) then S := ' '+ Err
      else S := 'DR' + Err + ' ';
   If Length(S) > 0 Then
      begin
         _WriteLn(S);
      end;
   dpError := copy(S,1,length(S));
end;